﻿using System;
using System.Collections.Generic;
using System.Linq;

using FluentNHibernate.Mapping;

namespace mForum.Infrastructure.NHibernate.Mappings
{
    using mForum.Domain.DomainObject;

    public class TopicMap : ClassMap<Topic>
    {
        public TopicMap()
        {
            Id(p => p.Id).GeneratedBy.Guid();

            Map(p => p.Name).Not.Nullable().Length(256);

            References(p => p.Forum);
            HasMany(p => p.Posts);
        }
    }
}
